//
//  STMHomeSectionCellView.m
//  StoreManagement
//
//  Created by centling on 16/5/11.
//  Copyright © 2016年 alfred. All rights reserved.
//

#import "STMHomeSectionCellView.h"

@implementation STMHomeSectionCellView

+(instancetype)loadViewWithName:(NSString *)nameStr numStr:(NSString *)numStr {
    STMHomeSectionCellView *view = [[[NSBundle mainBundle] loadNibNamed:@"STMHomeSectionCellView" owner:nil options:nil] lastObject];
    view.nameLabel.text = nameStr;
    view.numLabel.text = numStr;
    
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:view action:@selector(handleTap:)];
    [view addGestureRecognizer:tapGesture];
    return view;
}

- (void)handleTap:(UITapGestureRecognizer *)tap {
    if (_cellBlock) {
        _cellBlock(tap.view.tag);
    }
}

@end
